package com.example.tenant.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.example.tenant.Converter.CustomStringConverter;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * 角色关系表
 *
 * @author waterx
 * @date 2024-09-10 14:07:23
 */
@Data
@ColumnWidth(10)
@TableName("sys_role_relate")
@EqualsAndHashCode(callSuper = true)
public class SysRoleRelate extends Model<SysRoleRelate> {

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ExcelProperty("id")
    private String id;

    /**
     * 角色ID
     */
    @ExcelProperty("role_id")
    private String roleId;

    /**
     * 副角色ID
     */
    @ExcelProperty("vice_role_id")
    private String viceRoleId;

    /**
     * 关系类型 0继承 1互斥
     */
    @ExcelProperty("type")
    private String type;

    /**
     * 备注
     */
    @ExcelProperty("remark")
    private String remark;

    /**
     * 创建人
     */
    @ExcelProperty(value = "create_by", converter = CustomStringConverter.class)
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /**
     * 创建时间
     */
    @ExcelProperty("create_time")
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty(value = "update_by", converter = CustomStringConverter.class)
    private String updateBy;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelProperty("update_time")
    private Date updateTime;

}